public class ceshi {
    public static void main(String[] args) {
        String str = "Hello World";
        int n = 5; // 可以替换为任意满足条件的整数
        if(n>=0 && n<10)
        {
            for (int i = 0; i < n; i++) {
                if (n == (i+1))
                {
                    System.out.println("He" + n + n + "o Wor" + n + "d");
                }
                else
                {
                    System.out.println(str);
                }
            }
        }
        else {
            System.out.println("请输入正确的行数");
        }
    }
}
